{% extends "default/admin/include/innerBase.html" %}{% block mainer %}
<table id="paramList" class="elementList">
	<thead><tr fold="0">
    	<th width="60px"><div>顺序</div></th><th width="120px"><div>编码</div></th><th width="120px"><div>名称</div></th><th width="160px"><div>参数值</div></th>
    	<th width="160px"><div>描述</div></th><th width="80px"><div>是否显示</div></th><th><div>操作</div></th>
    </tr></thead>
{% for e in paramList %}{% include site.theme|stringformat:"s/admin/include/element.html" with e=e etype='param' %}{% endfor %}
<tr id="addParam" class="treetr"><td colspan="7"><span class="addtree"><a href="javascript:addElement();">添加参数</a></span></td></tr>
</table>
<div id="addtb" style="display:none;"><form><table class="formTable">{{paramForm}}</table></form></div>
<script type="text/javascript">
<!-- 
var addDlg,editDlg;
function addElement(){
	addDlg = $.dialog({
		id:'addDlg', title:'添加参数',
		content: $('#addtb').html(),
		max: false, min: false, lock: true,
		okVal: '增加',
	    ok: function(){
	    	var thisDlg = this;
	    	$.post('/admin/add!Param.do', $('form',thisDlg.DOM.content).serialize(), 
    			function(data){
	    		if(data.flag){$.dialog.alert(data.msg, function(){thisDlg.close();thisDlg.reload();});}
     				else{$.dialog.alert(data.msg);}
      			},'json');
	    	return false;
	    },
	    cancel: true
	});
}
function editElement(id){
	var url = 'url:/admin/detailParam-'+id+'.html';
	editDlg = $.dialog({
		id:'editDlg', title:'编辑栏目',
		content: url,
		max: false, min: false, lock: true, width: '300px',
		okVal: '编辑',
	    ok: function(){
	    	var thisDlg = this;
	    	var forms = $('form', thisDlg.iwin.document.body).serialize()+"&_retType=json";
	    	$.post('/admin/edit!Param.do', forms, 
    			function(data){
      				if(data.flag){$.dialog.alert(data.msg, function(){thisDlg.close();thisDlg.reload();});}
      				else{$.dialog.alert(data.msg);}
      			},'json');
	    	return false;
	    },
	    cancel: true
	});
}
$(function(){listHover();});
//-->
</script>
{% endblock %}